// @author A0105514U
package storage;

import static org.junit.Assert.*;
import org.junit.Test;

public class ModificationRecordTestDriver{
	ModificationRecord record;
	String recordAsString;
	String deletedTaskId;
	String addedFileName;
	
	@Test
	public void test1(){
		record = new ModificationRecord("add","task added","");
		addedFileName = "task added";
		assertEquals(record.getAddedFileName(),addedFileName);
		assertEquals(record.getModType(),"add");
	}
	
	// empty added task file name
	@Test
	public void test2_1(){
		record = new ModificationRecord("add","","");
		addedFileName = "";
		assertEquals(record.getAddedFileName(),addedFileName);
	}
	
	@Test
	public void test2_2(){
		record = new ModificationRecord("add","","");
		addedFileName = "";
		assertEquals(record.getModType(),"add");
	}
	
	// null added task file name
	@Test
	public void test3(){
		record = new ModificationRecord("add",null,"");
		addedFileName = "";
		assertEquals(record.getAddedFileName(),addedFileName);
	}
	
	// With both fields provided
	@Test
	public void test4(){
		record = new ModificationRecord("add","task added","idid");
		addedFileName = "task added";
		assertEquals(record.getAddedFileName(),addedFileName);
		assertEquals(record.getDeletedTaskId(),"");
	}
	
	// testing delete
	@Test
	public void test5(){
		record = new ModificationRecord("delete","","idid");
		deletedTaskId = "idid";
		assertEquals(record.getDeletedTaskId(),"idid");
		assertEquals(record.getModType(),"delete");
	}
}